Skip to content

Fix build: MultiNodeSubscriptionTrackingTests uses the renamed TryAdoptEndpoint - #3376

Merged
mgravell merged 1 commit into
mainfrom
marc/multinode-test-tryadopt
Nov 23, 2026
Merged

mgravell merged 1 commit into
mainfrom
marc/multinode-test-tryadopt

Conversation

@mgravell

Copy link
Copy Markdown
Member

main does not compile: #3374 added MultiNodeSubscriptionTrackingTests, which calls Subscription.AddEndpoint, and #3353 renamed that method to TryAdoptEndpoint. Each PR was green on its own and they merged without a textual conflict, but the test project fails with CS1061 once both are in.

One-line fix in the test: call TryAdoptEndpoint (asserting it returns true, which it always does for a multi-node subscription).

Verified locally on net10.0: the test project builds, and the in-process pub/sub, subscription, Sentinel, maintenance and topology tests pass (545 passed, 0 failed, three runs).

…ptEndpoint

#3374 added a test calling Subscription.AddEndpoint; #3353 renamed that to
TryAdoptEndpoint. Each was green alone and they merged without a textual
conflict, but main does not compile with both.
@mgravell
mgravell merged commit 2d75750 into main Nov 23, 2026
4 checks passed
@mgravell
mgravell deleted the marc/multinode-test-tryadopt branch November 23, 2026 16:32
mgravell added a commit that referenced this pull request Dec 3, 2026
* Docs: why WithRetry has no retrying batch, and what to use instead (#3388)

A batch's one guarantee is an uninterrupted run, which a retry would break:
a batch cannot be replayed as a unit (some of it may have applied), and
re-issuing just the failed element would reorder it. Document that, and the
alternatives: pipelined commands on the retrying database for independent
work (each retried by its own category), a retrying transaction for
all-or-nothing, and a plain batch where the uninterrupted run is what matters.

Closes #3370.

(cherry picked from commit 5e2e8e4)

* Stabilize two racy tests: keyspace notification counting, and the drain-cap MOVING test (#3393)

PubSubKeyNotificationTests counted an event in the total before counting its key. Multi-node
notifications arrive on several reader threads, so the last event could complete the run while
another, already in the total, had not yet counted its key: the per-key check came up one short
(expected 51, actual 50). Count the key first.

MovingWaitsForSlowCommandsThatFitInsideTheDrainCap needs exactly one 3s command in flight, but
SetLatency slowed every command, and the in-process server answers one at a time: a background
INFO ahead of the PING pushed the PING's reply to ~6s, past the 5s drain cap, so the recycle
failed it. Add a SetLatency overload that holds a single command, and slow only the PING.

(cherry picked from commit f5bf0c3)

* Resp3DowngradeTests: keep publishing until the restored subscription receives (#3396)

The test published once, straight after the interactive connection came back as RESP2. The subscription is
restored separately (with a dedicated connection, on a connection of its own), and a message published before
that SUBSCRIBE lands is not delivered, so on a slow runner the test waited 10s for a message that was never coming.
It now publishes every 250ms until one arrives, still within 10s, so a subscription that is never restored still
fails it.

(cherry picked from commit e56835e)

* Port main's small 3.5.0 fixes and test hardening to v4

- #3374 (+#3376): v4 already had the inverted-check fix; its regression test comes over
  (as #3374 shipped it - #3376's TryAdoptEndpoint rename belongs with #3353)
- #3361: v4 already disposes socketless tunnel streams; its regression test comes over
- #3386: the toy server's CLUSTER SLOTS snapshot fix; the other two windows are in
  code v4 replaced (QuitAllServers, PhysicalBridge creation; v4 executors connect lazily)
- #3395: already the v4 behaviour (GetConnectionId does not dial)
- #3394: not applicable; the test it fixes went with the old core
mgravell added a commit that referenced this pull request Dec 3, 2026
…vers (port of main #3353, #3376) (#3407)

v4 already keeps overlapping restores apart while one is in flight (HasSendInFlight, standing in for
main's claim), but recorded every acknowledgement unconditionally. A restore acknowledged by a second
server after the in-flight window (it is bounded by time) replaced the recorded server while the first
registration stayed live, delivering every message twice (#3336).

- TryAdoptEndpoint: a single-node subscription refuses an ack from a different server while its
  recorded one is live; the settle path then unsubscribes the stray (fire-and-forget, pinned to that
  server). Multi-node subscriptions adopt every ack.
- Only an internal restore defers to the attempt in flight, and counts as a pending change (1, not 0);
  a user subscribe sends its own and returns once that is acknowledged, as main's review follow-up.
- Clearing a stale recorded server is a compare-and-swap (EnsureSubscribedToServer[Async],
  RemoveIncorrectRouting, RemoveDisconnectedEndpoints), so a live server recorded by a concurrent ack
  is not wiped.

Main's SubscriptionRestoreRaceTests come across with the old-core sends replaced by v4's; all 16
failed on v4 before this. The fire-and-forget overlap case expects 0 rather than 1 from the deferred
restore, because v4 records a fire-and-forget subscribe's server when it is sent. Main's
MultiNodeSubscriptionTrackingTests (#3376's rename) applies as-is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant